package router

import (
	"server/api"

	"github.com/gin-gonic/gin"
)

type ArticleRouter struct {
}

func (a *ArticleRouter) InitArticleRouter(Router, PublicRouter, AdminRouter *gin.RouterGroup) {
	articleRouter := Router.Group("article")
	//articlePubleRouter := PublicRouter.Group("article")
	articleAdminRouter := AdminRouter.Group("article")

	articleApi := api.GroupApiApp.ArticleApi
	{
		articleRouter.POST("like", articleApi.ArticleLike)
		articleRouter.GET("isLike", articleApi.ArticleIsLike)
		articleRouter.GET("likesList", articleApi.ArticleLikesList)
	}

	{
		articleAdminRouter.POST("create", articleApi.ArticleCreate)
		articleAdminRouter.PUT("update", articleApi.ArticleUpdate)
		articleAdminRouter.DELETE("delete", articleApi.ArticleDelete)
		articleAdminRouter.GET("list", articleApi.ArticleList)
	}
}
